# -*- coding: utf-8 -*-
# @Time    : 2022/7/16 15:26
# @Author  : haichuan
# @Email   : 2263126410@163.com
# @File    : denglu_page.py
# @Software: PyCharm
from selenium.webdriver.common.by import By

class Deng_BasePage():
    login_name = (By.NAME ,'name')
    login_password = (By.NAME ,'password')
    login_ptn = (By.NAME ,'submit')
    touxiang= (By.CSS_SELECTOR, 'li.dropdown:nth-child(6) > a:nth-child(1)')
    # url="http://192.168.12.1/crm/"

    def __init__(self, driver):
        self.driver = driver
        driver.maximize_window ()

    def open(self):
        self.driver.get(self.url)

    def d_nam(self,user):
        '''用户名'''
        self.driver.find_element( *self.login_name ).send_keys( user )
    def d_pw(self,password):
        # 密码
        self.driver.find_element (*self.login_password).send_keys (password )
        # 登录按钮
        self.driver.find_element (*self.login_ptn).click ()

    def cilck_yhtxself(self):
        self.driver.find_element( *self.touxiang ).click()



